import { ipcMain } from "electron";
import { getMirrorFiles } from "./mirror-website.ts";
import { getNacosStableVersions } from "./nacos-io.ts";
import { getGolangDownloadList } from "@elec/main/spider/golang.ts";

/*
 * 爬虫
 */

(() => {
  ipcMain.handle("spider.getMirrorFiles", (_, url: string) => getMirrorFiles(url));

  ipcMain.handle("spider.nacos.getNacosStableVersions", _ => getNacosStableVersions());

  ipcMain.handle("spider.golang.getDownloadList", (_, prefix: string) => getGolangDownloadList(prefix));
})();
